<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:pn="http://pnengine.org/scheme" xmlns:x="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <head>
    <title><%= @transition.name %></title>
    <%=css_include_tag :transition, :layout, :xforms %>
  </head>
  <body>
    <div id='titleHead'>
      <h1><%= @transition.name || @transition.id %><%= " (" + @transition.action + ")" unless @transition.action.nil? %></h1>
    </div>
    
    <div class='container'>
      <p>The transition can fire with multiple token combinations. Choose one of the following!</p>
      <%@transition.token_combinations.each do |comb|%>
        <p>
          <% comb_case = comb.tokens[0].case unless comb.tokens[0].nil? %>
          <a href="<%= @transition.url(:case => comb_case) %>">
            <%= "Case #{comb_case.id}: " + comb.tokens.collect{|t| t.title || t.id}.join(" | ") %>
          </a>
          <% if Merb::Config[:use_reevaluation] %>
            Context
            - has transition:<%= comb_case.execution_context.has_transition?(@transition) %>
            - with equal input:<%= !comb_case.execution_context.get_modes_with_equal_input(@transition, comb.tokens).nil? %>
          <% end %>
        </p>
      <%end%>
    </div>
  </body>
</html>